package com.trailwalker.fragment;

import com.trailwalker.javafx.core.fragment.Fragment;
import com.trailwalker.javafx.utils.style.StyleUtils;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;

/**
 * @author Trailwalker
 * @create 2021-09-05 18:32
 */
public class FouthFragment extends Fragment {

    @Override
    public void onCreate() {
        super.onCreate();
        initView();
    }

    private void initView() {
        AnchorPane apRoot = new AnchorPane();
        setContentView(apRoot);
        StyleUtils.setBackgroundColor(apRoot, "#ff00ff");

        Button btnNext = new Button("上一页");
        apRoot.getChildren().add(btnNext);
        btnNext.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                finish();
            }
        });
    }
}
